<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<html>
<head>
    <meta charset="utf-8">
    <title>更多资讯</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="layui/css/layui.css" media="all">
    <link rel="stylesheet" href="css/public.css" media="all">
    <script src="layui/layui.js" type="text/javascript" charset="UTF-8"></script>
    <script src="js/jquery-3.6.3.js"></script>
</head>
<body>

<div class="layui-layout layui-layout-admin" style="margin-top: 60px">
    <div class="layui-header layui-bg-blue">
        <div class="layui-logo layui-hide-xs layui-bg-black">高校勤工助学平台</div>
        <!-- 头部区域（可配合layui 已有的水平导航） -->
        <ul class="layui-nav layui-layout-left" lay-filter="navleft">
            <!-- 移动端显示 -->
            <li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-header-event="menuLeft">
                <i class="layui-icon layui-icon-spread-left"></i>
            </li>
            <li class="layui-nav-item layui-hide-xs" ><a href="/toQzIndex">首页</a></li>
            <li class="layui-nav-item layui-hide-xs" ><a href="/toGwsqIndex" id="gwsq">岗位申请</a></li>
            <li class="layui-nav-item layui-hide-xs">
                <a href="javascript:;">我的申请</a>
                <dl class="layui-nav-child"> <!-- 二级菜单 -->
                    <dd><a href="/toWdsqIndex">正在申请</a></dd>
                    <dd><a href="/toWdsqIndex1">申请结果</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item layui-hide-xs" ><a href="/toQzCenter" id="grzx">个人中心</a></li>
            <li class="layui-nav-item layui-hide-xs" >
                <a href="javascript:;">联系反馈</a>
                <dl class="layui-nav-child" >
                    <dd><a lay-event="fankui">反馈信息</a></dd>
                    <dd>
                        <a >微信扫一扫</a>
                        <img style="width: 200px;height: 200px;" src="img/公众号1.jpg">
                    </dd>
                </dl>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right" lay-filter="demo">
            <li class="layui-nav-item layui-hide layui-show-md-inline-block">
                <a href="javascript:;">
                    <img src="//cdn.ilayuis.com/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg" tppabs="http://tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg" class="layui-nav-img">
                    <span id="roleName">用户</span>
                    <i class="layui-icon layui-icon-down layui-nav-more"></i>
                </a>
                <dl class="layui-nav-child">
                    <dd><a lay-event="change">修改密码</a></dd>
                    <dd><a href="/loginOut">退出登录</a></dd>
                </dl>
            </li>
        </ul>
    </div>
</div>
<div class="layui-container" style="width: 80%">
<!--    轮播图-->
    <div class="layui-fluid" style="width: 80%; height: 500px; margin-top:75px;">
        <div class="layui-carousel" id="test1">
            <div carousel-item>
                <div><a href=""><img src="img/轮播1.jpg" style="width: 100%; height:auto;" /></a></div>
                <div><a href=""><img src="img/轮播2.png" style="width: 100%; height:auto;" /></a></div>
                <div><a href="/toGwsqIndex"><img src="img/轮播3.png" style="width: 100%; height:auto;" /></a></div>
            </div>
        </div>
        <!-- 条目中可以是任意内容，如：<img src=""> -->
    </div>

<!--    内容-->
    <div class="layui-panel" style="width: 80%; margin: auto">
        <div style="padding: 50px;">
            <div style="height: 400px; overflow-y: auto;">
                <ul style="height: 380px">
                    <li id="zp_ul"></li>
                </ul>
            </div>

        </div>
    </div>

    <br><br>

    <div class="layui-card layui-panel">
        <div class="layui-card-header">
            下面是充数内容，为的是出现滚动条
        </div>
        <div class="layui-card-body">
        </div>
    </div>
</div>


<script>

    layui.use(['element'], function () {
        var $ = layui.jquery,
            element = layui.element;
            element.init();

        //当页面一加载时就向后台发送post请求,获取当前用户的姓名
        $(function(){
            $.post("../getusername",function(obj){
                $("#roleName").html(obj.name);
            },"json")
        });
    });

    layui.use('carousel', function(){
        var carousel = layui.carousel;
        //建造实例
        carousel.render({
            elem: '#test1'
            ,width: '100%'    //设置容器宽度
            ,height:'100%'
            ,arrow: 'always'//始终显示箭头
            ,autoplay: 'true',
            //,anim: 'updown' //切换动画方式
        });
    });
</script>

<script>

    $(function(){
        $.ajax({
            type: 'get',
            url: window.location.protocol + '//' + window.location.host + '/QzZpZixun',
            success: function (data) {
                //while (data.size)
                console.log(data)
                var count = 1;
                for (let i = (data.length - 1); i >= 0; i--) {
                    var zid = data[i].id;
                    $('#zp_ul').append("<li style='padding-top:10px; font-size: 30px;'>" + "<span class='layui-col-md9'>" +
                        "<i id="+ zid + " class='layui-icon layui-icon-triangle-r'></i>" + "&nbsp;<a href='/zixunDetail?id="
                        +zid+"'>" + data[i].title + "</a></span>" +
                        "<span class='layui-col-md3'>" + data[i].time + "</span></li>" + "<hr>");
                    count++;
                }
            },
            error: function () {
                var txt3=document.createElement("p");  // 以 DOM 创建新元素
                txt3.innerHTML="数据加载异常！";
                $("#zp_ul").append(txt3);
            }
        });
    })
</script>
<script src="js/nav.js"></script>
</body>
</html>